//
//  VehicleListCell.m
//  StarOrangeStaff
//
//  Created by lshenrong on 2020/6/29.
//  Copyright © 2020 lshenrong. All rights reserved.
//

#import "VehicleListCell.h"

@interface VehicleListCell ()

@property (nonatomic,strong) UILabel *brandLbl;
@property (nonatomic,strong) UILabel *carNumberLbl;
@property (nonatomic,strong) UILabel *seatLbl;
@property (nonatomic,strong) UILabel *nameLbl;

@end


@implementation VehicleListCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self!=nil){
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.brandLbl];
        [self.contentView addSubview:self.carNumberLbl];
        [self.contentView addSubview:self.seatLbl];
        [self.contentView addSubview:self.nameLbl];
        
        self.nameLbl.layer.borderWidth = 0.5;
        self.nameLbl.layer.cornerRadius = 5;
        self.nameLbl.layer.borderColor = kLightBlackColor2.CGColor;
        self.nameLbl.textAlignment = NSTextAlignmentCenter;

        [self.brandLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.contentView).mas_offset(kMarginOffsetX);
            make.centerY.mas_equalTo(self.contentView.mas_centerY);
        }];
        
        [self.carNumberLbl  mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self.brandLbl.mas_right).mas_offset(40);
            make.centerY.mas_equalTo(self.contentView.mas_centerY);
        }];
        
        [self.seatLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(self.nameLbl.mas_left).mas_offset(-40);
            make.centerY.mas_equalTo(self.contentView.mas_centerY);
        }];
        
        [self.nameLbl mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.mas_equalTo(self.contentView).mas_offset(-kMarginOffsetX);
            make.centerY.mas_equalTo(self.contentView.mas_centerY);
            make.width.mas_equalTo(50);

        }];

        
        
    }
    return self;
}

+ (CGFloat)heightForCell{
    return 60.0 ;
}

MACRO_UILabel_LazyloadWithPFCGFont(brandLbl, @"别克商务2020款", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(carNumberLbl, @"粤A100AS", kOrangeColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(seatLbl, @"7座", kBlackColor, 15)
MACRO_UILabel_LazyloadWithPFCGFont(nameLbl, @"张某某", kLightBlackColor2, 14)

@end
